package spring_ioc.hello2;

import spring_ioc.hello2.service.Action;
import spring_ioc.hello2.service.LowerAction;
import spring_ioc.hello2.service.UpperAction;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Test1_InJunit {
    @Test
    public void test() {
        AnnotationConfigApplicationContext ctx =
                new AnnotationConfigApplicationContext(DoAnnoConfig.class);

        Action action1 = ctx.getBean(LowerAction.class);
        Action action2 = ctx.getBean(UpperAction.class);

        action1.execute("Rod Johnson");
        action2.execute("Rod Johnson");

        ctx.close();
    }
}
